package com.antler.smt.utils;

import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;

/**
 * 邮件工具类
 *
 * @author vic
 * @date 2018-03-26 13:50
 */
public class SendMailUtil {
    /**
     * 发送简单邮件
     *
     * @param mailSender 邮件发送类
     * @param mailFrom 发件人地址
     * @param receiver 收件人地址
     * @param subject  主题
     * @param content  内容
     */
    public static void sendSimpleMail(JavaMailSender mailSender, String mailFrom, String receiver, String subject, String content) {
        SimpleMailMessage message = new SimpleMailMessage();
        message.setFrom(mailFrom);
        message.setTo(receiver);
        message.setSubject(subject);
        message.setText(content);
        mailSender.send(message);
    }
}
